#include "../header.h"
int main(int argc, char const *argv[])
{
    FILE *fp1,*fp2;
    char fname[128]={0};
    if(argc!=2)
    {
        printf("Usage:%s <input file> <output file>",argv[0]);
        return -1;
    }
    if((fp1=fopen(argv[1],"r"))==NULL)
    {   
        printf("Cannot open file %s",argv[1]);
        return -1;
    }
    snprintf(fname,sizeof(fname),"new_%s",argv[1]);
    if((fp2=fopen(fname,"w"))==NULL)
    {
        printf("Cannot open file %s",argv[2]);
        return -1;
    }
    char s[50];
    while(fgets(s,sizeof(s),fp1))
    {
        fputs(s,fp2);
    }
    fclose(fp1);
    fclose(fp2);        
    return 0;
}
